<?php
namespace app\index\model;

use app\common\model\Base;
class Xiaoxi extends Base
{
	//更新已读消息(单条)
	public function updateNotice($id,$ifdq) {
		$res = Xiaoxi::name('xiaoxi')->bind(['id'=>$id,'ifdq'=>$ifdq])->where(['id'=>':id'])->update(['ifdq'=>':ifdq']);	
		return $res;
	}
	//更新已读消息(全部)
	public function updateNotices($username,$ifdq) {
	    $res = Xiaoxi::name('xiaoxi')->bind(['username'=>$username,'ifdq'=>$ifdq])->where(['username'=>':username'])->update(['ifdq'=>':ifdq']);
	    return $res;
	}
	//发送消息
	public function sendNotice($username,$ifdq) {
	    $res = Xiaoxi::name('xiaoxi')->bind(['username'=>$username,'ifdq'=>$ifdq])->where(['username'=>':username'])->update(['ifdq'=>':ifdq']);
	    return $res;
	}
	
}